package com.lyd.cotroller;

import com.lyd.mapper.UserMapper;
import com.lyd.pojo.User;
import com.lyd.server.UserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;
import java.util.List;

@Controller
public class UserController {
    @Autowired()
    public UserServer userServer;

    @GetMapping("/user")
    public String getAllUser(Model mv){
        List<User> list = userServer.getAllUser();
        mv.addAttribute(list);
        System.out.println("------------------------------------------------------------------"+list);
        return "AllUser";
    }

}
